Function Subspace :: _rs literal

template <::sus::ops::__private::RangeLiteralDeducer<true> D>
auto operator""_rs() -> auto

Constructs an isize range from a literal.

The constructed range satisfies the RangeBounds<isize> concept. Numbers may be positive or negative.

The syntax is a string (in double quotes) containing:

  • start..end for a range including start and excluding end. This returns a sus::ops::Range<isize>.
  • start..=end for a range including start and including end. This returns a sus::ops::Range<isize>.
  • start.. for a range including start and never ending. This returns a sus::ops::RangeFrom<isize>.
  • ..end for a range including everything up end. This returns a sus::ops::RangeTo<isize>.
  • ..=end for a range including everything up and including end. This returns a sus::ops::RangeTo<isize>.
  • .. for a range that has no bounds at all. Typically for a slicing range to indicate the entire slice. This returns a sus::ops::RangeFull<isize>.

Examples

sus_check("1..4"_rs).start == 1);
sus_check(("1..4"_rs).finish == 4);
sus_check(("1..=4"_rs).finish == 5);